//
//  SimpleStorageService.m
//  aloqa
//
//  Created by mkoo sun on 12-8-24.
//  Copyright (c) 2012年 exodus. All rights reserved.
//

#import "SimpleStorageService.h"
#import "Config.h"

@implementation SimpleStorageService

//-------------------------------------------------------------------------------------------
- (id)init
{
    self = [super init];
    if (self) {
        storages = [[NSMutableDictionary alloc]init];
    }
    return self;
}

- (void)dealloc
{
    [storages release];
    storages = nil;
    
    [super dealloc];
}

//-------------------------------------------------------------------------------------------
-(SimpleStorage*)openStorage:(NSString*)name
{
    SimpleStorage* storage = [storages objectForKey:name];
    if(!storage)
    {
        storage = [[SimpleStorage alloc]initWithName:name];
        [storages setValue:storage forKey:name];
        [storage release];
    }

    return storage;
}

//-------------------------------------------------------------------------------------------
-(void)deleteStorage:(NSString*)name
{
//    SimpleStorage* storage = [storages objectForKey:name];
//    if(storage)
//    {
//        [storages removeObjectForKey:name];
//    }
}

@end
